<%@ Page Language="C#" AutoEventWireup="true" CodeFile="search.aspx.cs" Inherits="Views_Grurrah_search" MasterPageFile="~/Views/layouts/default_w_sidebar.master" %>

<%@ Register Assembly="Gaia.WebWidgets" Namespace="Gaia.WebWidgets" TagPrefix="gaia" %>
<%@ Register Assembly="Grr" Namespace="Grr.Web.WebControls" TagPrefix="grurrah" %>
<%@ Import Namespace="Grr.Models" %>

<asp:Content ContentPlaceHolderID="TitleType" runat="server">Search:</asp:Content>
<asp:Content ContentPlaceHolderID="TitleText" runat="server"><gaia:Label ID="SearchTermLabel" runat="Server"></gaia:Label></asp:Content>

<asp:Content ContentPlaceHolderID="MainContent" runat="server">
<div id="search-container">
        <gaia:Panel ID="ResultsPanel" Visible="true" runat="server">
            <% if (Result != null && Result.Matches.Count > 0) { %>
            <ol start="<%= CurrentResultsIndex + 1 %>">
                <% foreach (SearchMatch result in Result.Matches) {  %>
                    <li>
                        <a href="<%= ResolveUrl (result.Url) %>"><%= result.Title %></a>:
                        <%= result.Description %>
                    </li>
                <% } %>
            </ol>
            <% } else if (SearchTerm.Length !=0) { %>
                Sorry, no results found. Perhaps you would like to <a href="<%= ResolveUrl ("~/create/") %>">create a new Grurrah</a>?
            <% } %>
            </gaia:Panel>
            <div class="results-paging-buttons">
                <gaia:LinkButton ID="PrevButton" Visible="false" Text="[Prev]" runat="server" OnClick="PrevButton_Click"></gaia:LinkButton>
                <gaia:LinkButton ID="NextButton" Visible="false" Text="[Next]" runat="server" OnClick="NextButton_Click"></gaia:LinkButton>
            </div>
         <div id="search_again">
             <gaia:TextBox CssClass="search-box" ID="SearchAgainTextBox" Text="Search" runat="server" onfocus="javascript:search_focus_in (this.id);" onblur="javascript:search_focus_out (this.id);"></gaia:TextBox>
             <gaia:Button CssClass="search-submit" ID="SearchAgainButton" Text="GO" runat="server" OnClick="SearchAgainButton_Click" />
         </div>
        
</div>        
</asp:Content>

